package com.imooc.mq;

import com.imooc.api.mq.RabbitMQSMSConfig;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 啊昌
 * @date 2025/9/19 20:10
 * RabbitMQSMSConsumer 短信消费者
 */
@Slf4j
@Component
public class RabbitMQSMSConsumer {

	@RabbitListener(queues = {RabbitMQSMSConfig.SMS_QUEUE}) // 监听短信队列
	public void watchQueue(String payload, Message message) {
		log.info("监听到短信队列消息：{}", payload);
		log.info("消息：{}", message.toString());
	}
}
